<!--1.摄像头显示-->
<script setup lang="ts">
import { ref } from "vue";
const src = ref("");
const camera_src = "api/stream?topic=/usb_cam/image_raw";
function showView01() {
  console.log("viwe01");
  src.value = "api/stream?topic=/usb_cam/image_raw";
}
function showView02() {
  console.log("viwe02");
  src.value = "api/stream?topic=/usb_cam/image_raw";
}
function showView03() {
  console.log("viwe03");
  src.value = "api/stream?topic=/usb_cam/image_raw";
}
</script>

<template>
  <div>
    <el-row :gutter="10">
      <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
        <el-card>
          <template #header>
            <div class="card-header">
              <span>Visualization</span>
              <el-button class="button" text @click="showView01"
                >viwe01</el-button
              >
              <el-button class="button" text @click="showView02"
                >view02</el-button
              >
              <el-button class="button" text @click="showView03"
                >view03</el-button
              >
            </div>
          </template>
          <el-image :src="src" :fit="'fill'" />
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
        <el-card>
          <template #header>
            <div class="card-header">
              <span>Camera</span>
            </div>
          </template>
          <el-image :src="camera_src" :fit="'fill'" />
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<style scoped>
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.box-card {
  width: 480px;
}
</style>
